<include file="Public/header" title="{$siteSetting['site_seo_title']}" keywords="{$siteSetting['site_seo_keywords']}" description="{$siteSetting['site_seo_description']}" />

<!-- bootstrap-star-rating
<link rel="stylesheet" href="__TMPL__Public/assets/plugins/bootstrap-star-rating/css/star-rating.min.css" />
<script src="__TMPL__Public/assets/plugins/bootstrap-star-rating/js/star-rating.min.js"></script> -->
	
	<!-- MAIN -->
    <main class="x-content x-m-b-50">
		<!-- img -->
		<div class="x-relative">
    		<img src="__ROOT__/{$thumb}" class="img-responsive" alt="{$thumb}" />
			<!-- <div class="x-info-bottom">
				<h3 class="x-title">{$name}</h3>
			</div> -->
    	</div>
		
		<section class="x-box with-border x-m-b-10 post">			
			<div class="x-box-header with-border post-header">
				<h3 class="post-title">{$name}</h3>
				<div class="post-meta">
					<i class="fa fa-clock-o"></i>&nbsp;<span>{$update_time|strtotime|date='Y-m-d h:i',###}</span>&nbsp;&nbsp;
					<i class="fa fa-user"></i>&nbsp;<span>{$author}</span>&nbsp;&nbsp;
					<i class="fa fa-eye"></i>&nbsp;<span>{$view_count}</span>&nbsp;人浏览
				</div>
			</div>
			<div class="x-box-body post-body">
				<ul class="x-row code-list">
					<content id="vo" table-name="code" where="tid=$id" order="id asc">
					<li class="x-col-12-12">
						<a href="javascript:;" class="x-row code-item" onclick="javascript:fillReg({$vo.id});return false;">
							<span class="x-col-10-12 x-p-10">
								<span class="x-row">
									<span class="x-col-8-12"><h3>{$vo.name}</h3></span>
									<span class="x-col-4-12"><span class="text-orange x-pull-right" style="font-size:0.2rem;">¥{$vo.price}</span></span></h3>
									<!-- <php>$typeArray = ['', '小班', '中班', '大班', '小学'];$index=$vo.type</php>
									<span class="x-badge bg-red" id="corner-cart-num">{$typeArray[1]}</span> -->
									<p class="x-col-12-12">时间：<span class="text-default">{$vo.start_datetime}</span> 至 <span class="text-default">{$vo.end_datetime}</span></p>
								</span>
							</span>
							<span class="x-col-2-12 item-icon">
								<i class="ion-ios-arrow-forward"></i><i class="ion-ios-arrow-forward"></i>
							</span>
						</a>
					</li>
					</content>
				</ul>
				
				<ul class="x-row x-list-value post-attr">
					<li class="x-col-12-12 with-border">
						<div class="x-row">
							<div class="x-col-3-12 x-label-name">集合时间</div>
							<div class="x-col-9-12 x-label-value">{$gather_time}</div>
						</div>
					</li>
					<li class="x-col-12-12 with-border">
						<div class="x-row">
							<div class="x-col-3-12 x-label-name">集合地点</div>
							<div class="x-col-9-12 x-label-value">{$gather_address}</div>
						</div>
					</li>
					<li class="x-col-12-12 with-border">
						<div class="x-row">
							<div class="x-col-3-12 x-label-name">乘车路线</div>
							<div class="x-col-9-12 x-label-value">{$way}</div>
						</div>
					</li>
					<li class="x-col-12-12 with-border">
						<div class="x-row">
							<div class="x-col-3-12 x-label-name">联系方式</div>
							<div class="x-col-9-12 x-label-value">{$contact}</div>
						</div>
					</li>
				</ul>
				<div class="post-summary">
					{$summary}
				</div>
				<div class="post-content">
					{$content}
				</div>
			</div>
		</section>
    </main>
    <!-- /MAIN -->
    
	<!-- FOOTER -->
    <footer class="x-footer">
		<ul class="x-row x-footer-bar with-border-top">
			<li class="x-col-6-12">
				<button class="button button-block button-default button-large" id="btn-buy" onclick="javascript:history.go(-1);return false;">返回</button>
			</li>
			<li class="x-col-6-12">
				<button class="button button-block button-caution button-large" id="btn-buy" onclick="javascript:fillReg();return false;">报名</button>
			</li>
		</ul>
	</footer>
	<!-- /FOOTER -->

<script type="text/javascript">
(function() {
})();

function fillReg(codeId) {
	if (!'{$customer}') {
		// alert
	   	xpop({
	       	title: '友情提示',
	        msg: '您还没有完善信息，请完善信息',
	        buttons: [{
	            text: '取消',
	            'class': 'weui_btn_dialog default',
	            handler: function ($this) {
	        		$this.destroy();
	            }
	        }, {
	            text: '确定',
	            'class': 'weui_btn_dialog primary',
	            handler: function ($this) {
	        		$this.destroy();
	        		window.location.href = "{:U('Customer/Login/register')}";
	            }
	        }]
	    });
		
		return false;
	}
	
	var url = "{:U('Wechat/Index/fillreg')}?tid={$id}";		// + codeId={$vo.id}'
	if (codeId) {
		url += '&codeId=' + codeId;
	}
	window.location.href = url;
}
</script>
